package com.itheima.d2_buffered_stream;

import java.io.*;

/**
 * 目标：掌握字符缓冲输入流的用法。
 */
public class Test2BufferedReader {
    public static void main(String[] args) throws FileNotFoundException {
        File file = new File("day10io-app2/file/出师表.txt");
        File file1 =new File("day10io-app2/lib/出师表.txt");
        try(FileInputStream fis = new FileInputStream(file);
            FileOutputStream fos = new FileOutputStream(file1);

            BufferedInputStream bis = new BufferedInputStream(fis);
            BufferedOutputStream bof = new BufferedOutputStream(fos);){

            int len;
            while ((len = bis.read()) != -1) {
                bof.write(len);
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
